#include <stdint.h>

#define freq_doh   1046                                               // 1046Hz
#define freq_reh   1175
#define freq_mih   1318
#define freq_fah   1397
#define freq_soh   1568
#define freq_lah   1760
#define freq_sih   1976

#define freq_do    523                                                // 523Hz
#define freq_re    587
#define freq_mi    659
#define freq_fa    698
#define freq_so    784
#define freq_la    880
#define freq_si    988

#define freq_dol   262                                                // 262Hz
#define freq_rel   294
#define freq_mil   330
#define freq_fal   349
#define freq_sol   392
#define freq_lal   440
#define freq_sil   494

#define freq_Pclk  48000000

#define Arr_1h    ( freq_Pclk / freq_doh / 2 - 1 )
#define Arr_2h    ( freq_Pclk / freq_reh / 2 - 1 )
#define Arr_3h    ( freq_Pclk / freq_mih / 2 - 1 )
#define Arr_4h    ( freq_Pclk / freq_fah / 2 - 1 )
#define Arr_5h    ( freq_Pclk / freq_soh / 2 - 1 )
#define Arr_6h    ( freq_Pclk / freq_lah / 2 - 1 )
#define Arr_7h    ( freq_Pclk / freq_sih / 2 - 1 )

#define Arr_1     ( freq_Pclk / freq_do  / 2 - 1 )
#define Arr_2     ( freq_Pclk / freq_re  / 2 - 1 )
#define Arr_3     ( freq_Pclk / freq_mi  / 2 - 1 )
#define Arr_4     ( freq_Pclk / freq_fa  / 2 - 1 )
#define Arr_5     ( freq_Pclk / freq_so  / 2 - 1 )
#define Arr_6     ( freq_Pclk / freq_la  / 2 - 1 )
#define Arr_7     ( freq_Pclk / freq_si  / 2 - 1 )

#define Arr_1l    ( freq_Pclk / freq_dol / 2 - 1 )
#define Arr_2l    ( freq_Pclk / freq_rel / 2 - 1 )
#define Arr_3l    ( freq_Pclk / freq_mil / 2 - 1 )
#define Arr_4l    ( freq_Pclk / freq_fal / 2 - 1 )
#define Arr_5l    ( freq_Pclk / freq_sol / 2 - 1 )
#define Arr_6l    ( freq_Pclk / freq_lal / 2 - 1 )
#define Arr_7l    ( freq_Pclk / freq_sil / 2 - 1 )


//#define Note8  250                                                  // 62ms， 八分之一音符的延时
//#define Note4  500                                                  // 125ms， 四分之一音符的延时

#define Note16 90
#define Note8  180
#define Note8p5 270
#define Note4  360
#define Note4p5 540
#define Note2  720

void AlwaysWithMe(void);
void Carnon(void);
void HotBlooded(void);
void TwoTiggers(void);
